<?php
class console_finder_branch_product
{
    var $column_barcode = "条形码";
    var $column_barcode_width = "100";
    function column_barcode($row){
        
        #基础物料的条形码
        $basicMaterialCodeObj    = app::get('material')->model('codebase');
        $code    = $basicMaterialCodeObj->dump(array('bm_id'=>$row['product_id'], 'type_id'=>1), 'code');
        
        return $code['code'];
    }
    
    var $column_bn = "货号";
    var $column_bn_width = "300";
    var $column_bn_order_field = "p.bn";
    function column_bn($row){
        return $row['bn'];
    }
    
    var $column_store_position_width = "150";
    function column_store_position($row){
       return $row['store_position'];
    }

    var $column_product_name = "货品名称";
    var $column_product_name_width = "100";
    function column_product_name($row){
        if ($row['sku_property']) $str = "(".$row['sku_property'].")";
        return $row['name'].$str;
    }
    
    var $column_spec_info = '规格';
    var $column_spec_info_width='80';
    function column_spec_info($row)
    {
        #基础物料的规格
        $basicMaterialExtObj = app::get('material')->model('basic_material_ext');
        $spec    = $basicMaterialExtObj->dump(array('bm_id'=>$row['product_id']), 'specifications');
        
        return $spec['specifications'];
    }
    
    var $column_branch_name = "仓库";
    var $column_branch_name_width = "150";
    function column_branch_name($row)
    {
        $brObj = app::get('ome')->model('branch');
        $aRow = $brObj->dump($row['branch_id'], 'name');
        
        return $aRow['name'];
    }
}

